{"componentChunkName":"component---node-modules-rocketseat-gatsby-theme-docs-core-src-templates-docs-query-js","path":"/code-style","result":{"data":{"mdx":{"id":"d40b4b85-96fa-55bf-8fd6-60039112460e","excerpt":"During the manual portion of the audit, we identified  15 optimizations  that can be applied to the codebase that will decrease the gas-cost associated with the…","fields":{"slug":"/code-style/"},"frontmatter":{"title":"Code Style","description":"Describes the dedicated section of coding style and optimizational findings of the audit","image":null,"disableTableOfContents":null},"body":"var _excluded = [\"components\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsxRuntime classic */\n\n/* @jsx mdx */\nvar _frontmatter = {\n  \"title\": \"Code Style\",\n  \"description\": \"Describes the dedicated section of coding style and optimizational findings of the audit\"\n};\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, _excluded);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"p\", null, \"During the manual portion of the audit, we identified \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"15 optimizations\"), \" that can be applied to the codebase that will decrease the gas-cost associated with the execution of a particular function and generally ensure that the project complies with the latest best practices and standards in Solidity.\"), mdx(\"p\", null, \"Additionally, this section of the audit contains any opinionated adjustments we believe the code should make to make it more legible as well as truer to its purpose.\"), mdx(\"p\", null, \"These optimizations are enumerated below:\"), mdx(\"table\", null, mdx(\"thead\", {\n    parentName: \"table\"\n  }, mdx(\"tr\", {\n    parentName: \"thead\"\n  }, mdx(\"th\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"ID\"), mdx(\"th\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Severity\"), mdx(\"th\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Addressed\"), mdx(\"th\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Title\"))), mdx(\"tbody\", {\n    parentName: \"table\"\n  }, mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"/stakewise-eth2-staking-implementation/code-style/ERC20PermitUpgradeable-ERP#ERP-01C\"\n  }, \"ERP-01C\")), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Informational\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"No\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Sub-Optimal EIP-712 Implementation\")), mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"/stakewise-eth2-staking-implementation/code-style/ERC20PermitUpgradeable-ERP#ERP-02C\"\n  }, \"ERP-02C\")), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Informational\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"No\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Unoptimized Variable Mutability\")), mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"/stakewise-eth2-staking-implementation/code-style/ERC20Upgradeable-ERC#ERC-01C\"\n  }, \"ERC-01C\")), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Informational\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"No\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Deprecated Maximum Representation Style\")), mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"/stakewise-eth2-staking-implementation/code-style/Oracles-ORA#ORA-01C\"\n  }, \"ORA-01C\")), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Informational\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Yes\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Inefficient Block Number Comparison\")), mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"/stakewise-eth2-staking-implementation/code-style/Oracles-ORA#ORA-02C\"\n  }, \"ORA-02C\")), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Informational\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Yes\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Multiple Top-Level Declarations\")), mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"/stakewise-eth2-staking-implementation/code-style/Oracles-ORA#ORA-03C\"\n  }, \"ORA-03C\")), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Informational\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"No\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Redundant Visibility Specifier\")), mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"/stakewise-eth2-staking-implementation/code-style/Oracles-ORA#ORA-04C\"\n  }, \"ORA-04C\")), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Informational\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Yes\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Undocumented Consortium Level\")), mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"/stakewise-eth2-staking-implementation/code-style/OwnablePausable-OPE#OPE-01C\"\n  }, \"OPE-01C\")), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Informational\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"No\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Redundant Visibility Specifier\")), mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"/stakewise-eth2-staking-implementation/code-style/OwnablePausableUpgradeable-OPU#OPU-01C\"\n  }, \"OPU-01C\")), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Informational\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"No\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Redundant Visibility Specifier\")), mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"/stakewise-eth2-staking-implementation/code-style/Pool-POO#POO-01C\"\n  }, \"POO-01C\")), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Informational\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Yes\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Undocumented Value Literal\")), mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"/stakewise-eth2-staking-implementation/code-style/PoolValidators-PVS#PVS-01C\"\n  }, \"PVS-01C\")), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Informational\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"No\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Redundant Root Validations\")), mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"/stakewise-eth2-staking-implementation/code-style/RewardEthToken-RET#RET-01C\"\n  }, \"RET-01C\")), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Informational\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Yes\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Duplicate Event Emittance & Storage Write\")), mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"/stakewise-eth2-staking-implementation/code-style/Roles-ROL#ROL-01C\"\n  }, \"ROL-01C\")), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Informational\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Yes\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Unspecified Numerical Accuracy\")), mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"/stakewise-eth2-staking-implementation/code-style/StakedEthToken-SET#SET-01C\"\n  }, \"SET-01C\")), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Informational\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"No\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Incorrect Gas Optimization\")), mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"/stakewise-eth2-staking-implementation/code-style/StakedEthToken-SET#SET-02C\"\n  }, \"SET-02C\")), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Informational\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"No\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Potential XOR Optimization\")))));\n}\n;\nMDXContent.isMDXComponent = true;","headings":[]}},"pageContext":{"slug":"/code-style/","prev":{"label":"Manual Review","link":"/manual-review"},"next":{"label":"ERC20Upgradeable.sol (ERC-S)","link":"/static-analysis/ERC20Upgradeable-ERC"}}},"staticQueryHashes":["1954253342","2328931024","2501019404","973074209"]}